package com.sunducation.co.bpw.serializable;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * @description: 序列化
 * @author:chenwenbiao
 * @createTime:2019/7/9 18:50
 * @version：1.0
 **/
public class SerialTest {

    public static void main(String[] args) throws IOException {
        Person person = new Person(1, "chenwenbiao");
        System.out.println("Person Serial" + person);
        FileOutputStream fos = new FileOutputStream("Person.txt");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(person);
        oos.flush();
        oos.close();
    }
}
